<%--
  Created by IntelliJ IDEA.
  User: yangtao
  Date: 2021-11-26
  Time: 18:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="app-title">
    <div>
        <h1><i class="fa fa-pie-chart"></i> 项目管理</h1>
    </div>
    <ul class="app-breadcrumb breadcrumb">
        <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
        <li class="breadcrumb-item"><a href="#">技术创新</a></li>
        <li class="breadcrumb-item"><a href="#">项目管理</a></li>
    </ul>
</div>

<div id="content" class="tile">
</div>

<script type="text/javascript">
    //加载table
    function loadTable(num) {
        if (typeof (num) == "undefined") {
            var num = 1;
        }
        $("#content").load("${ctx}/project_list?page=" + num);
    }

    loadTable();

    function deleteProject(pkId) {
        $("#overlay").css("display", "");
        $.ajax({
            type: "get",
            url: "/delete_project",
            dataType: "text",
            data: {"pkId": pkId},
            success: function (result) {
                $("#content").html(result);
                $("#overlay").css("display", "none");
            }
        })
    }

    function toUpdateProject(pkId) {
        $.ajax({
            type: "get",
            url: "/to_project_update",
            dataType: "text",
            data: {"pkId": pkId},
            success: function (result) {
                $(".app-content").html(result);
            },
            error: function (result) {

            }
        });
    }

    function isEmpty(obj) {
        if (typeof obj === 'undefined' || obj == null || obj === '') {
            return true;
        } else {
            return false;
        }
    }

</script>